package com.foreveross.crawl.common.exception;

/**
 * 自定义业务异常类
 * @author luofangyi
 *
 */
public class BusinessException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7271867045954767934L;
	
	private int errorCode;

	public int getErrorCode() {
		return errorCode;
	}
	public BusinessException(){
		super();
	}
	public BusinessException(String msg){
		super(msg);
	}
	
	public BusinessException(int errorCode, String msg){
		super(String.format("error Code[%s]: %s", errorCode, msg));
		this.errorCode = errorCode;
	}
	
	public BusinessException(String msg, Throwable cause){
		super(msg, cause);
	}
	
	public BusinessException(int errorCode, String msg, Throwable cause){
		super(String.format("error Code[%s]: %s", errorCode, msg), cause);
		this.errorCode = errorCode;
	}
}
